package com.campus.counseling.model.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.campus.counseling.entity.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
    
    @Select("SELECT menu_id FROM sys_role_menu WHERE role_id = #{roleId}")
    List<Long> selectMenuIdsByRoleId(@Param("roleId") Long roleId);
    
    // 批量插入角色菜单关系
    void batchInsert(@Param("roleId") Long roleId, @Param("menuIds") List<Long> menuIds);
    
    // 根据角色ID删除角色菜单关系
    void deleteByRoleId(@Param("roleId") Long roleId);
    
    // 根据菜单ID删除角色菜单关系
    void deleteByMenuId(@Param("menuId") Long menuId);
} 